﻿Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Collections
Imports System.Windows.Forms
Imports DataObject
Imports DataObject.hDBase

Public Class BusLoaiHopDongLD

    Private LoaiHopDongLDDAO As New SqlServerLoaiHopDongLD
    Private oTable As New DataTable

    Public Function GetAllLoaiHopDongLD(ByVal sStringConnection As String) As Object
        Try
            oTable = LoaiHopDongLDDAO.GetAllLoaiHopDongLD(sStringConnection)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        Return oTable
    End Function

    Public Sub InsertLoaiHopDongLD(ByVal sStringConnection As String, ByVal oLoaiHopDongLD As LoaiHopDongLD)
        Try
            LoaiHopDongLDDAO.InsertLoaiHopDongLD(sStringConnection, oLoaiHopDongLD)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub UpdateLoaiHopDongLD(ByVal sStringConnection As String, ByVal oLoaiHopDongLD As LoaiHopDongLD)
        Dim bool_ As Boolean = True
        Try
            LoaiHopDongLDDAO.UpdateLoaiHopDongLD(sStringConnection, oLoaiHopDongLD)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub DeleteLoaiHopDongLD(ByVal sStringConnection As String, ByVal oLoaiHopDongLD As LoaiHopDongLD)
        Try
            LoaiHopDongLDDAO.DeleteLoaiHopDongLD(sStringConnection, oLoaiHopDongLD.SoLoaiHDLD)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

End Class
